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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: J = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.s: C = None
        self.w: H = None
        self.p: E = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: I = None
        self.y: C = None
        self.q: E = None
        self.s: A = None
        self.v: C = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: J = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: C = None
        self.s: C = None
        self.w: H = None
        self.p: E = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.u: I = None
        self.y: C = None
        self.q: E = None
        self.s: A = None
        self.v: C = None
        self.w: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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