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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: I = None
        self.z: H = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: H = None
        self.u: H = None
        self.y: A = None
        self.p: C = None
        self.x: H = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: J = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.u: F = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: B = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: B = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: I = None
        self.z: H = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: H = None
        self.u: H = None
        self.y: A = None
        self.p: C = None
        self.x: H = None
        self.r: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: J = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: A = None
        self.u: F = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: B = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

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