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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.r: A = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: H = None
        self.x: G = None
        self.y: D = None
        self.t: B = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.x: F = None
        self.w: C = None
        self.r: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: C = None
        self.r: A = None
        self.y: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: H = None
        self.x: G = None
        self.y: D = None
        self.t: B = None
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.x: F = None
        self.w: C = None
        self.r: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.z: I = None
        self.txt = txt

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

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

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

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