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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.p: A = None
        self.r: E = None
        self.t: E = None
        self.v: I = None
        self.w: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: C = None
        self.p: A = None
        self.r: E = None
        self.t: E = None
        self.v: I = None
        self.w: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

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