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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: B = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: B = None
        self.p: F = None
        self.t: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.q: D = None
        self.z: B = None
        self.txt = txt

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

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

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