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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: F = None
        self.p: E = None
        self.s: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: I = None
        self.x: I = None
        self.t: B = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: I = None
        self.w: E = None
        self.p: E = None
        self.y: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.o: E = None
        self.y: G = None
        self.z: E = None
        self.w: F = None
        self.t: G = None
        self.txt = txt

e = A("e")
b = B("b")
a = C("a")
g = D("g")
j = E("j")
d = F("d")
f = G("f")
h = H("h")
i = I("i")
m = J("m")

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: F = None
        self.p: E = None
        self.s: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: I = None
        self.x: I = None
        self.t: B = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: I = None
        self.w: E = None
        self.p: E = None
        self.y: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: G = None
        self.o: E = None
        self.y: G = None
        self.z: E = None
        self.w: F = None
        self.t: G = None
        self.txt = txt

e = A("e")
b = B("b")
a = C("a")
g = D("g")
j = E("j")
d = F("d")
f = G("f")
h = H("h")
i = I("i")
m = J("m")

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