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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: E = None
        self.u: J = None
        self.s: E = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.v: I = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: E = None
        self.s: G = None
        self.v: I = None
        self.u: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.x: D = None
        self.z: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: E = None
        self.u: J = None
        self.s: E = None
        self.p: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: B = None
        self.v: I = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: E = None
        self.s: G = None
        self.v: I = None
        self.u: D = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.x: D = None
        self.z: E = None
        self.y: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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