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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.x: D = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.o: A = None
        self.u: G = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: F = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: H = None
        self.o: A = None
        self.x: G = None
        self.r: A = None
        self.q: B = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: H = None
        self.q: C = None
        self.o: D = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.y: B = None
        self.z: E = None
        self.txt = txt

g = A("g")
d = B("d")
b = C("b")
a = D("a")
c = E("c")
n = F("n")
k = G("k")
h = H("h")
f = C("f")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.x: D = None
        self.u: A = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.o: A = None
        self.u: G = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: F = None
        self.w: F = None
        self.u: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: H = None
        self.o: A = None
        self.x: G = None
        self.r: A = None
        self.q: B = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: H = None
        self.q: C = None
        self.o: D = None
        self.w: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.y: B = None
        self.z: E = None
        self.txt = txt

g = A("g")
d = B("d")
b = C("b")
a = D("a")
c = E("c")
n = F("n")
k = G("k")
h = H("h")
f = C("f")
m = H("m")

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