class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: A = None
        self.txt = txt

e = A("e")
l = B("l")
h = A("h")
n = B("n")
c = A("c")
b = B("b")
f = B("f")
g = B("g")
m = A("m")
j = A("j")

e.y = b
e.w = b
l.u = f
l.x = j
h.y = b
h.w = l
n.u = l
n.x = j
c.y = g
c.w = n
b.u = f
b.x = h
f.u = b
f.x = c
g.u = n
g.x = e
m.y = g
m.w = b
j.y = g
j.w = g
assert e.w.x.y.u.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: A = None
        self.txt = txt

e = A("e")
l = B("l")
h = A("h")
n = B("n")
c = A("c")
b = B("b")
f = B("f")
g = B("g")
m = A("m")
j = A("j")

e.y = b
e.w = b
l.u = f
l.x = j
h.y = b
h.w = l
n.u = l
n.x = j
c.y = g
c.w = n
b.u = f
b.x = h
f.u = b
f.x = c
g.u = n
g.x = e
m.y = g
m.w = b
j.y = g
j.w = g
assert e.w.x.y.u.x.y.txt == "g"