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

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

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

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

i = A("i")
l = B("l")
b = C("b")
h = D("h")
g = B("g")
a = B("a")
k = A("k")
n = D("n")

i.x = h
l.w = h
l.t = k
l.u = a
b.p = n
b.v = i
b.q = a
h.z = a
h.u = n
g.w = h
g.t = k
g.u = l
a.w = h
a.t = k
a.u = l
k.x = h
n.z = l
n.u = h
assert i.x.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

i = A("i")
l = B("l")
b = C("b")
h = D("h")
g = B("g")
a = B("a")
k = A("k")
n = D("n")

i.x = h
l.w = h
l.t = k
l.u = a
b.p = n
b.v = i
b.q = a
h.z = a
h.u = n
g.w = h
g.t = k
g.u = l
a.w = h
a.t = k
a.u = l
k.x = h
n.z = l
n.u = h
assert i.x.z.t.txt == "k"