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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: D = None
        self.s: H = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: D = None
        self.s: H = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

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

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