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

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

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

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

m = A("m")
h = B("h")
l = C("l")
j = D("j")
a = A("a")
k = C("k")
i = D("i")
g = C("g")
e = A("e")

m.s = a
m.q = j
m.t = i
m.u = h
h.x = i
l.u = h
l.z = i
j.p = l
j.v = i
j.u = i
a.s = m
a.q = j
a.t = i
a.u = h
k.u = h
k.z = i
i.p = k
i.v = j
i.u = j
g.u = h
g.z = j
e.s = m
e.q = j
e.t = j
e.u = h
assert e.q.v.u.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: D = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

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

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

m = A("m")
h = B("h")
l = C("l")
j = D("j")
a = A("a")
k = C("k")
i = D("i")
g = C("g")
e = A("e")

m.s = a
m.q = j
m.t = i
m.u = h
h.x = i
l.u = h
l.z = i
j.p = l
j.v = i
j.u = i
a.s = m
a.q = j
a.t = i
a.u = h
k.u = h
k.z = i
i.p = k
i.v = j
i.u = j
g.u = h
g.z = j
e.s = m
e.q = j
e.t = j
e.u = h
assert e.q.v.u.p.txt == "l"