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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: F = None
        self.t: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.t: D = None
        self.v: F = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

e = A("e")
a = B("a")
h = C("h")
j = D("j")
c = E("c")
b = F("b")
l = C("l")

e.q = c
e.o = c
e.w = a
e.u = l
a.o = e
a.z = e
a.w = e
h.u = c
h.q = b
j.u = h
j.z = h
j.y = b
j.t = b
c.z = a
c.x = a
c.r = l
c.t = j
c.p = j
c.v = b
b.r = l
l.u = c
l.q = b
assert a.z.w.z.o.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.u: C = None
        self.o: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: F = None
        self.t: F = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: C = None
        self.t: D = None
        self.v: F = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

e = A("e")
a = B("a")
h = C("h")
j = D("j")
c = E("c")
b = F("b")
l = C("l")

e.q = c
e.o = c
e.w = a
e.u = l
a.o = e
a.z = e
a.w = e
h.u = c
h.q = b
j.u = h
j.z = h
j.y = b
j.t = b
c.z = a
c.x = a
c.r = l
c.t = j
c.p = j
c.v = b
b.r = l
l.u = c
l.q = b
assert a.z.w.z.o.z.w.txt == "e"