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

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

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

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

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

n.t = m
n.w = g
n.u = i
f.x = l
l.v = h
l.u = h
l.x = h
g.p = l
c.t = m
c.w = m
c.u = f
e.t = g
e.w = m
e.u = j
j.x = h
h.v = l
h.u = l
h.x = l
i.x = l
m.p = l
assert g.p.u.x.v.x.v.v.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.w: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

n.t = m
n.w = g
n.u = i
f.x = l
l.v = h
l.u = h
l.x = h
g.p = l
c.t = m
c.w = m
c.u = f
e.t = g
e.w = m
e.u = j
j.x = h
h.v = l
h.u = l
h.x = l
i.x = l
m.p = l
assert g.p.u.x.v.x.v.v.u.x.txt == "l"