class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: J = None
        self.r: E = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: F = None
        self.z: G = None
        self.o: F = None
        self.y: F = None
        self.t: D = None
        self.u: G = None
        self.w: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: C = None
        self.t: I = None
        self.w: A = None
        self.p: E = None
        self.z: E = None
        self.y: E = None
        self.v: F = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: D = None
        self.t: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: J = None
        self.r: E = None
        self.v: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: F = None
        self.z: G = None
        self.o: F = None
        self.y: F = None
        self.t: D = None
        self.u: G = None
        self.w: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: C = None
        self.t: I = None
        self.w: A = None
        self.p: E = None
        self.z: E = None
        self.y: E = None
        self.v: F = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: D = None
        self.t: A = None
        self.txt = txt

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

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