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

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

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

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

c = A("c")
n = B("n")
a = C("a")
e = D("e")
b = C("b")
h = C("h")

c.y = e
c.u = b
c.t = h
n.y = c
a.v = n
a.u = e
a.w = c
a.x = c
e.t = a
e.v = n
e.s = c
b.v = n
b.u = e
b.w = c
b.x = c
h.v = n
h.u = e
h.w = c
h.x = c
assert c.u.v.y.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

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

c = A("c")
n = B("n")
a = C("a")
e = D("e")
b = C("b")
h = C("h")

c.y = e
c.u = b
c.t = h
n.y = c
a.v = n
a.u = e
a.w = c
a.x = c
e.t = a
e.v = n
e.s = c
b.v = n
b.u = e
b.w = c
b.x = c
h.v = n
h.u = e
h.w = c
h.x = c
assert c.u.v.y.t.x.txt == "c"