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

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

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

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

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

j = A("j")
i = B("i")
f = C("f")
k = D("k")
m = E("m")
n = B("n")
e = D("e")
a = E("a")
b = A("b")

j.o = b
j.s = b
j.q = i
j.u = f
i.o = a
i.q = k
f.u = n
f.t = a
f.w = m
f.r = b
f.q = e
k.w = i
m.q = b
m.o = i
m.x = j
n.o = a
n.q = k
e.w = n
a.q = j
a.x = j
a.o = n
b.o = j
b.s = j
b.q = n
b.u = f
assert a.x.q.o.q.o.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: B = None
        self.s: A = None
        self.u: C = None
        self.txt = txt

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

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

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

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

j = A("j")
i = B("i")
f = C("f")
k = D("k")
m = E("m")
n = B("n")
e = D("e")
a = E("a")
b = A("b")

j.o = b
j.s = b
j.q = i
j.u = f
i.o = a
i.q = k
f.u = n
f.t = a
f.w = m
f.r = b
f.q = e
k.w = i
m.q = b
m.o = i
m.x = j
n.o = a
n.q = k
e.w = n
a.q = j
a.x = j
a.o = n
b.o = j
b.s = j
b.q = n
b.u = f
assert a.x.q.o.q.o.q.o.txt == "a"