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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.z: E = None
        self.q: E = None
        self.v: D = None
        self.t: I = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: A = None
        self.u: G = None
        self.o: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.y: B = None
        self.w: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.z: E = None
        self.q: E = None
        self.v: D = None
        self.t: I = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: A = None
        self.u: G = None
        self.o: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: E = None
        self.y: B = None
        self.w: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: D = None
        self.txt = txt

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

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

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