Satisfiability Of Equality Equation

medium
You are given an array of strings equations that represent relationships between variables where each string equations[i] is of length 4 and takes one of two different forms: x==y or x!=y. Here x and y represents lowercase letters. 

Input Format

First line contains an integer denoting the number of equation Each of next n line contains an equation of form "x==y" or "x!=y"

Output Format

print true if all equations can be satisfied else print false.

Constraints

1 <= equations.length <= 100000
equations[i].length == 4

Example

Input
2
b==c
c!=b
Output
false
Previous
Critical Connection
Next
Minimum Number Of Swaps Required To Sort An Array

Related Questions