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

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

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

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

l = A("l")
m = B("m")
i = C("i")
k = D("k")
f = A("f")
b = D("b")
n = C("n")
g = B("g")
c = B("c")
h = B("h")

l.s = b
l.z = c
m.u = b
m.v = g
m.x = i
m.t = i
i.u = n
i.r = k
i.x = g
k.y = n
k.p = n
k.u = n
k.x = n
f.s = k
f.z = g
b.y = n
b.p = n
b.x = n
b.u = i
n.u = i
n.r = k
n.x = h
g.u = b
g.v = m
g.x = n
g.t = i
c.u = b
c.v = g
c.x = n
c.t = i
h.u = b
h.v = g
h.x = n
h.t = n
assert n.u.r.p.u.x.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
i = C("i")
k = D("k")
f = A("f")
b = D("b")
n = C("n")
g = B("g")
c = B("c")
h = B("h")

l.s = b
l.z = c
m.u = b
m.v = g
m.x = i
m.t = i
i.u = n
i.r = k
i.x = g
k.y = n
k.p = n
k.u = n
k.x = n
f.s = k
f.z = g
b.y = n
b.p = n
b.x = n
b.u = i
n.u = i
n.r = k
n.x = h
g.u = b
g.v = m
g.x = n
g.t = i
c.u = b
c.v = g
c.x = n
c.t = i
h.u = b
h.v = g
h.x = n
h.t = n
assert n.u.r.p.u.x.v.t.txt == "i"