class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.o: E = None
        self.w: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.z: B = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: B = None
        self.y: D = None
        self.u: D = None
        self.txt = txt

e = A("e")
h = B("h")
l = C("l")
f = D("f")
a = E("a")
c = F("c")
k = D("k")
d = A("d")

e.w = c
e.q = a
e.o = a
e.u = d
h.q = f
h.v = c
h.z = c
h.o = a
h.w = d
l.r = f
f.x = a
a.q = k
a.o = h
a.z = h
a.p = c
a.v = e
c.x = h
c.o = h
c.y = f
c.u = k
k.x = a
d.w = c
d.q = a
d.o = a
d.u = e
assert e.w.u.x.v.u.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: F = None
        self.o: E = None
        self.w: A = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.o: B = None
        self.z: B = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: B = None
        self.y: D = None
        self.u: D = None
        self.txt = txt

e = A("e")
h = B("h")
l = C("l")
f = D("f")
a = E("a")
c = F("c")
k = D("k")
d = A("d")

e.w = c
e.q = a
e.o = a
e.u = d
h.q = f
h.v = c
h.z = c
h.o = a
h.w = d
l.r = f
f.x = a
a.q = k
a.o = h
a.z = h
a.p = c
a.v = e
c.x = h
c.o = h
c.y = f
c.u = k
k.x = a
d.w = c
d.q = a
d.o = a
d.u = e
assert e.w.u.x.v.u.w.o.txt == "h"