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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: A = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: H = None
        self.y: C = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: G = None
        self.o: G = None
        self.q: F = None
        self.s: F = None
        self.w: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.x: B = None
        self.t: A = None
        self.r: B = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: A = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: H = None
        self.y: C = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: G = None
        self.o: G = None
        self.q: F = None
        self.s: F = None
        self.w: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: C = None
        self.x: B = None
        self.t: A = None
        self.r: B = None
        self.v: E = None
        self.q: D = None
        self.txt = txt

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

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