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

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

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

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

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

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

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

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

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

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

c.w = h
c.z = l
f.y = a
f.s = a
f.v = h
k.p = n
k.s = n
k.u = c
h.x = n
h.t = a
h.o = c
h.y = c
a.x = n
a.t = h
a.o = l
a.y = l
n.p = k
n.s = k
n.u = l
j.y = h
j.s = h
j.v = a
l.w = a
l.z = c
assert a.t.x.u.txt == "l"