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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.x: E = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: D = None
        self.o: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.r: A = None
        self.w: D = None
        self.s: H = None
        self.v: I = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: I = None
        self.z: I = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.v: G = None
        self.z: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: D = None
        self.x: E = None
        self.r: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: D = None
        self.o: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: D = None
        self.r: A = None
        self.w: D = None
        self.s: H = None
        self.v: I = None
        self.p: F = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: I = None
        self.z: I = None
        self.r: D = None
        self.u: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.v: G = None
        self.z: G = None
        self.txt = txt

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

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

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