class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: A = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

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

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

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

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

e = A("e")
f = B("f")
j = C("j")
b = D("b")
c = E("c")
a = E("a")
k = A("k")

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

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

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

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

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

e = A("e")
f = B("f")
j = C("j")
b = D("b")
c = E("c")
a = E("a")
k = A("k")

e.t = a
e.o = k
e.x = b
e.q = j
f.r = b
f.x = b
f.q = b
f.w = c
j.z = b
j.x = k
j.t = a
b.y = j
b.v = j
b.r = k
b.w = e
c.o = a
a.o = c
k.t = c
k.o = e
k.x = b
k.q = j
assert e.o.o.q.x.q.x.q.txt == "j"