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

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

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

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

c = A("c")
a = B("a")
h = C("h")
e = D("e")
l = C("l")
f = A("f")
j = B("j")

c.t = f
c.z = e
c.o = e
c.w = e
a.v = j
h.z = l
h.u = l
h.y = e
h.r = c
e.p = j
e.u = a
l.z = h
l.u = h
l.y = e
l.r = f
f.t = c
f.z = e
f.o = e
f.w = e
j.v = a
assert h.y.u.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: D = None
        self.o: D = None
        self.w: D = None
        self.txt = txt

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

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

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

c = A("c")
a = B("a")
h = C("h")
e = D("e")
l = C("l")
f = A("f")
j = B("j")

c.t = f
c.z = e
c.o = e
c.w = e
a.v = j
h.z = l
h.u = l
h.y = e
h.r = c
e.p = j
e.u = a
l.z = h
l.u = h
l.y = e
l.r = f
f.t = c
f.z = e
f.o = e
f.w = e
j.v = a
assert h.y.u.v.v.v.v.v.txt == "j"