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

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

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

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

k = A("k")
b = B("b")
j = C("j")
f = D("f")
l = C("l")
e = C("e")
d = B("d")

k.t = f
b.t = l
b.y = j
b.z = j
b.r = k
j.t = b
j.y = b
j.w = e
j.q = l
f.o = l
f.z = l
f.t = e
l.t = b
l.w = j
l.q = j
l.y = d
e.t = d
e.y = d
e.w = l
e.q = l
d.t = l
d.y = e
d.z = e
d.r = k
assert d.t.t.y.y.r.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

k = A("k")
b = B("b")
j = C("j")
f = D("f")
l = C("l")
e = C("e")
d = B("d")

k.t = f
b.t = l
b.y = j
b.z = j
b.r = k
j.t = b
j.y = b
j.w = e
j.q = l
f.o = l
f.z = l
f.t = e
l.t = b
l.w = j
l.q = j
l.y = d
e.t = d
e.y = d
e.w = l
e.q = l
d.t = l
d.y = e
d.z = e
d.r = k
assert d.t.t.y.y.r.t.t.txt == "e"