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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: C = None
        self.r: J = None
        self.q: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.p: C = None
        self.r: J = None
        self.q: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: E = None
        self.txt = txt

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

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

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