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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.v: H = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.x: E = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

m = A("m")
i = B("i")
d = C("d")
a = D("a")
c = E("c")
n = F("n")
g = G("g")
k = H("k")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: A = None
        self.v: H = None
        self.o: G = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: E = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: B = None
        self.x: E = None
        self.v: A = None
        self.t: A = None
        self.txt = txt

m = A("m")
i = B("i")
d = C("d")
a = D("a")
c = E("c")
n = F("n")
g = G("g")
k = H("k")

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