class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

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

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

j = A("j")
d = B("d")
a = C("a")
e = D("e")
k = B("k")
i = D("i")
c = C("c")

j.y = a
j.w = e
j.v = i
d.u = a
d.o = i
d.r = k
a.p = j
a.u = k
e.q = a
e.t = c
e.u = k
k.u = a
k.o = i
k.r = d
i.q = c
i.t = c
i.u = d
c.p = j
c.u = d
assert e.t.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.v: D = None
        self.txt = txt

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

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

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

j = A("j")
d = B("d")
a = C("a")
e = D("e")
k = B("k")
i = D("i")
c = C("c")

j.y = a
j.w = e
j.v = i
d.u = a
d.o = i
d.r = k
a.p = j
a.u = k
e.q = a
e.t = c
e.u = k
k.u = a
k.o = i
k.r = d
i.q = c
i.t = c
i.u = d
c.p = j
c.u = d
assert e.t.u.u.txt == "a"