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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: A = None
        self.t: A = None
        self.r: H = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.q: J = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.s: D = None
        self.y: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: A = None
        self.t: A = None
        self.r: H = None
        self.z: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: H = None
        self.q: J = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.s: D = None
        self.y: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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