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

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

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

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

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

f = A("f")
h = B("h")
n = C("n")
d = D("d")
a = E("a")
g = E("g")
l = E("l")
e = D("e")
c = C("c")
k = B("k")

f.z = k
f.u = a
h.w = d
h.u = d
h.r = n
h.q = c
h.p = k
n.u = c
n.t = c
n.v = a
n.w = l
d.t = f
d.u = f
d.r = e
a.w = e
a.u = k
g.w = e
g.u = k
l.w = e
l.u = k
e.t = f
e.u = f
e.r = d
c.u = n
c.t = n
c.v = a
c.w = l
k.w = e
k.r = n
k.q = n
k.u = d
k.p = h
assert g.u.p.w.r.r.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
n = C("n")
d = D("d")
a = E("a")
g = E("g")
l = E("l")
e = D("e")
c = C("c")
k = B("k")

f.z = k
f.u = a
h.w = d
h.u = d
h.r = n
h.q = c
h.p = k
n.u = c
n.t = c
n.v = a
n.w = l
d.t = f
d.u = f
d.r = e
a.w = e
a.u = k
g.w = e
g.u = k
l.w = e
l.u = k
e.t = f
e.u = f
e.r = d
c.u = n
c.t = n
c.v = a
c.w = l
k.w = e
k.r = n
k.q = n
k.u = d
k.p = h
assert g.u.p.w.r.r.r.u.txt == "f"