class A:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: D = None
        self.q: H = None
        self.r: D = None
        self.w: G = None
        self.p: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: C = None
        self.y: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: A = None
        self.t: C = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: A = None
        self.q: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.t: I = None
        self.w: D = None
        self.v: H = None
        self.o: B = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: C = None
        self.y: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: A = None
        self.t: C = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.o: A = None
        self.q: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.t: I = None
        self.w: D = None
        self.v: H = None
        self.o: B = None
        self.z: D = None
        self.txt = txt

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

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