class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

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

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

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

l = A("l")
b = B("b")
a = C("a")
c = D("c")
f = A("f")
j = C("j")
d = C("d")
k = C("k")
i = B("i")

l.q = b
l.t = b
l.y = d
l.z = c
b.u = i
b.q = c
a.v = l
a.o = c
a.s = f
a.t = f
c.o = i
c.r = i
f.q = i
f.y = k
f.z = c
f.t = b
j.v = f
j.s = f
j.t = f
j.o = c
d.v = f
d.s = f
d.t = f
d.o = c
k.v = f
k.s = f
k.o = c
k.t = l
i.u = b
i.q = c
assert b.u.q.r.q.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.z: D = None
        self.t: B = None
        self.txt = txt

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

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

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

l = A("l")
b = B("b")
a = C("a")
c = D("c")
f = A("f")
j = C("j")
d = C("d")
k = C("k")
i = B("i")

l.q = b
l.t = b
l.y = d
l.z = c
b.u = i
b.q = c
a.v = l
a.o = c
a.s = f
a.t = f
c.o = i
c.r = i
f.q = i
f.y = k
f.z = c
f.t = b
j.v = f
j.s = f
j.t = f
j.o = c
d.v = f
d.s = f
d.t = f
d.o = c
k.v = f
k.s = f
k.o = c
k.t = l
i.u = b
i.q = c
assert b.u.q.r.q.r.u.txt == "b"