class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: B = None
        self.o: C = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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