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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.t: H = None
        self.q: F = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: D = None
        self.y: C = None
        self.p: J = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: J = None
        self.t: F = None
        self.y: A = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: E = None
        self.t: H = None
        self.q: F = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: D = None
        self.y: C = None
        self.p: J = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: I = None
        self.x: J = None
        self.t: F = None
        self.y: A = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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