class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.s: B = None
        self.v: C = None
        self.txt = txt

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

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

j.q = i
j.z = i
f.w = i
f.p = i
f.q = l
f.v = c
e.s = f
e.r = j
e.o = k
c.x = j
c.o = l
c.v = l
c.s = b
k.v = e
k.w = i
k.r = l
k.y = l
k.t = f
b.w = i
b.p = i
b.q = e
b.v = c
l.s = f
l.r = j
l.o = k
i.q = j
i.z = j
assert i.q.q.q.q.z.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: A = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: C = None
        self.s: B = None
        self.v: C = None
        self.txt = txt

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

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

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