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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

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

h = A("h")
a = B("a")
d = C("d")
l = D("l")
g = E("g")
e = F("e")
b = E("b")
n = E("n")
m = B("m")
c = B("c")

h.r = l
h.q = n
h.z = d
h.u = d
h.p = a
a.u = l
a.v = d
a.o = e
a.z = c
d.v = e
d.u = h
d.o = a
l.u = d
l.s = d
l.p = h
g.u = h
g.q = d
e.r = l
e.t = h
b.u = h
b.q = d
n.u = h
n.q = d
m.u = l
m.v = d
m.o = e
m.z = c
c.u = l
c.v = d
c.o = e
c.z = m
assert m.z.u.p.r.p.z.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.z: C = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

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

h = A("h")
a = B("a")
d = C("d")
l = D("l")
g = E("g")
e = F("e")
b = E("b")
n = E("n")
m = B("m")
c = B("c")

h.r = l
h.q = n
h.z = d
h.u = d
h.p = a
a.u = l
a.v = d
a.o = e
a.z = c
d.v = e
d.u = h
d.o = a
l.u = d
l.s = d
l.p = h
g.u = h
g.q = d
e.r = l
e.t = h
b.u = h
b.q = d
n.u = h
n.q = d
m.u = l
m.v = d
m.o = e
m.z = c
c.u = l
c.v = d
c.o = e
c.z = m
assert m.z.u.p.r.p.z.v.t.txt == "h"