class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.w: D = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.x: F = None
        self.q: F = None
        self.s: F = None
        self.v: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

i.y = h
m.x = k
m.r = h
m.z = h
m.w = c
m.o = g
h.y = i
h.t = d
h.x = l
h.q = l
h.s = l
h.v = n
c.x = m
e.u = c
e.p = c
e.x = l
e.t = h
l.q = n
n.u = k
n.x = l
n.t = h
n.p = c
g.x = k
g.r = h
g.z = h
g.w = c
g.o = m
k.x = m
d.y = h
assert d.y.y.y.x.q.t.q.q.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: C = None
        self.w: D = None
        self.o: B = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.x: F = None
        self.q: F = None
        self.s: F = None
        self.v: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

i.y = h
m.x = k
m.r = h
m.z = h
m.w = c
m.o = g
h.y = i
h.t = d
h.x = l
h.q = l
h.s = l
h.v = n
c.x = m
e.u = c
e.p = c
e.x = l
e.t = h
l.q = n
n.u = k
n.x = l
n.t = h
n.p = c
g.x = k
g.r = h
g.z = h
g.w = c
g.o = m
k.x = m
d.y = h
assert d.y.y.y.x.q.t.q.q.u.x.txt == "m"