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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.x: J = None
        self.t: H = None
        self.q: C = None
        self.r: I = None
        self.s: B = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: F = None
        self.v: F = None
        self.y: A = None
        self.w: H = None
        self.t: I = None
        self.s: G = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: B = None
        self.u: F = None
        self.z: I = None
        self.q: H = None
        self.x: I = None
        self.t: J = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.x: J = None
        self.t: H = None
        self.q: C = None
        self.r: I = None
        self.s: B = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: F = None
        self.v: F = None
        self.y: A = None
        self.w: H = None
        self.t: I = None
        self.s: G = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: B = None
        self.u: F = None
        self.z: I = None
        self.q: H = None
        self.x: I = None
        self.t: J = None
        self.txt = txt

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

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

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

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

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