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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: G = None
        self.s: H = None
        self.u: G = None
        self.t: G = None
        self.z: F = None
        self.w: I = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.y: H = None
        self.v: E = None
        self.p: I = None
        self.z: E = None
        self.w: C = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: G = None
        self.s: H = None
        self.u: G = None
        self.t: G = None
        self.z: F = None
        self.w: I = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: C = None
        self.y: H = None
        self.v: E = None
        self.p: I = None
        self.z: E = None
        self.w: C = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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