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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.y: F = None
        self.x: F = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: J = None
        self.x: E = None
        self.w: J = None
        self.v: E = None
        self.o: B = None
        self.z: H = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.r: J = None
        self.w: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: J = None
        self.y: F = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: I = None
        self.x: E = None
        self.o: G = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.r: D = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: E = None
        self.y: F = None
        self.x: F = None
        self.z: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: J = None
        self.x: E = None
        self.w: J = None
        self.v: E = None
        self.o: B = None
        self.z: H = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: C = None
        self.r: J = None
        self.w: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: J = None
        self.y: F = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: I = None
        self.x: E = None
        self.o: G = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.r: D = None
        self.x: A = None
        self.txt = txt

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

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