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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.r: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.p: C = None
        self.r: A = None
        self.t: H = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.r: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.p: C = None
        self.r: A = None
        self.t: H = None
        self.y: A = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: D = None
        self.u: E = None
        self.txt = txt

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

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