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

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

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

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

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

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

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

h.z = c
b.u = g
b.x = g
b.v = i
b.t = a
b.z = k
b.q = c
k.r = h
k.x = a
k.p = i
m.v = b
m.t = k
m.s = k
m.y = i
m.u = c
m.z = c
i.r = k
i.z = b
i.t = a
a.y = c
a.o = k
c.v = g
c.t = k
c.s = k
c.y = i
c.u = m
c.z = m
g.u = b
g.x = b
g.v = i
g.t = a
g.z = k
g.q = m
assert a.o.p.z.u.q.t.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

h.z = c
b.u = g
b.x = g
b.v = i
b.t = a
b.z = k
b.q = c
k.r = h
k.x = a
k.p = i
m.v = b
m.t = k
m.s = k
m.y = i
m.u = c
m.z = c
i.r = k
i.z = b
i.t = a
a.y = c
a.o = k
c.v = g
c.t = k
c.s = k
c.y = i
c.u = m
c.z = m
g.u = b
g.x = b
g.v = i
g.t = a
g.z = k
g.q = m
assert a.o.p.z.u.q.t.p.r.txt == "k"