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

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

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

e = A("e")
n = B("n")
a = C("a")
d = B("d")
c = C("c")
j = B("j")

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

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

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

e = A("e")
n = B("n")
a = C("a")
d = B("d")
c = C("c")
j = B("j")

e.u = c
e.t = n
n.p = e
n.y = a
a.v = j
a.u = e
a.x = c
d.p = e
d.y = a
c.v = d
c.u = e
c.x = a
j.p = e
j.y = c
assert d.y.u.u.v.txt == "d"