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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: G = None
        self.o: G = None
        self.z: J = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: A = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: G = None
        self.p: A = None
        self.s: F = None
        self.o: E = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.z: G = None
        self.t: C = None
        self.r: G = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: G = None
        self.o: G = None
        self.z: J = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: E = None
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.y: A = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: G = None
        self.p: A = None
        self.s: F = None
        self.o: E = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: D = None
        self.z: G = None
        self.t: C = None
        self.r: G = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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