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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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