class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.txt = txt

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

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