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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

c.y = e
c.x = i
i.x = d
a.t = e
a.p = c
b.v = e
b.t = i
b.s = c
e.t = a
e.p = c
d.y = e
d.x = i
j.v = a
j.t = i
j.s = c
l.v = a
l.t = i
l.s = c
assert c.y.p.y.p.y.p.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

c.y = e
c.x = i
i.x = d
a.t = e
a.p = c
b.v = e
b.t = i
b.s = c
e.t = a
e.p = c
d.y = e
d.x = i
j.v = a
j.t = i
j.s = c
l.v = a
l.t = i
l.s = c
assert c.y.p.y.p.y.p.x.x.txt == "d"