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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.y: H = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.z: J = None
        self.q: A = None
        self.w: I = None
        self.o: B = None
        self.u: H = None
        self.v: J = None
        self.r: G = None
        self.s: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: B = None
        self.q: A = None
        self.y: C = None
        self.o: J = None
        self.w: C = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: H = None
        self.u: E = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: F = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.y: H = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: J = None
        self.z: J = None
        self.q: A = None
        self.w: I = None
        self.o: B = None
        self.u: H = None
        self.v: J = None
        self.r: G = None
        self.s: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: B = None
        self.q: A = None
        self.y: C = None
        self.o: J = None
        self.w: C = None
        self.u: C = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: H = None
        self.u: E = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: F = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: C = None
        self.v: C = None
        self.txt = txt

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

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