class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.y: D = None
        self.w: G = None
        self.s: J = None
        self.r: D = None
        self.q: B = None
        self.u: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.y: D = None
        self.w: G = None
        self.s: J = None
        self.r: D = None
        self.q: B = None
        self.u: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: B = None
        self.txt = txt

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

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