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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: J = None
        self.z: D = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: E = None
        self.z: I = None
        self.p: I = None
        self.v: B = None
        self.r: D = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: J = None
        self.w: C = None
        self.r: I = None
        self.v: I = None
        self.z: D = None
        self.p: J = None
        self.y: J = None
        self.u: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: F = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: J = None
        self.z: D = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: E = None
        self.z: I = None
        self.p: I = None
        self.v: B = None
        self.r: D = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: J = None
        self.w: C = None
        self.r: I = None
        self.v: I = None
        self.z: D = None
        self.p: J = None
        self.y: J = None
        self.u: J = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: F = None
        self.y: A = None
        self.txt = txt

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

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