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

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

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

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

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

i = A("i")
m = B("m")
j = C("j")
l = D("l")
h = E("h")
d = A("d")
f = D("f")
n = C("n")
k = B("k")
b = C("b")

i.q = d
i.x = d
i.t = m
i.w = h
i.o = b
m.r = j
j.o = m
l.x = k
l.q = k
l.o = f
l.r = f
l.s = h
h.o = l
h.x = k
h.y = b
h.q = j
h.z = n
d.q = i
d.x = i
d.t = m
d.w = h
d.o = n
f.x = m
f.q = m
f.o = l
f.r = l
f.s = h
n.o = k
k.r = n
b.o = m
assert k.r.o.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: A = None
        self.t: B = None
        self.w: E = None
        self.o: C = None
        self.txt = txt

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

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

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

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

i = A("i")
m = B("m")
j = C("j")
l = D("l")
h = E("h")
d = A("d")
f = D("f")
n = C("n")
k = B("k")
b = C("b")

i.q = d
i.x = d
i.t = m
i.w = h
i.o = b
m.r = j
j.o = m
l.x = k
l.q = k
l.o = f
l.r = f
l.s = h
h.o = l
h.x = k
h.y = b
h.q = j
h.z = n
d.q = i
d.x = i
d.t = m
d.w = h
d.o = n
f.x = m
f.q = m
f.o = l
f.r = l
f.s = h
n.o = k
k.r = n
b.o = m
assert k.r.o.r.o.r.txt == "n"