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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

b.r = j
b.o = m
b.u = a
m.o = c
m.p = c
m.r = h
m.q = e
a.q = c
a.u = i
j.v = m
j.q = m
j.s = m
j.z = a
n.v = h
n.s = h
n.q = m
n.z = a
i.q = a
i.u = c
f.v = m
f.q = h
f.s = h
f.z = c
h.o = a
h.p = c
h.r = m
h.q = b
e.r = j
e.o = m
e.u = i
c.q = i
c.u = a
assert i.u.q.u.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: B = None
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

b.r = j
b.o = m
b.u = a
m.o = c
m.p = c
m.r = h
m.q = e
a.q = c
a.u = i
j.v = m
j.q = m
j.s = m
j.z = a
n.v = h
n.s = h
n.q = m
n.z = a
i.q = a
i.u = c
f.v = m
f.q = h
f.s = h
f.z = c
h.o = a
h.p = c
h.r = m
h.q = b
e.r = j
e.o = m
e.u = i
c.q = i
c.u = a
assert i.u.q.u.u.q.txt == "c"