class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.p: H = None
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: F = None
        self.s: H = None
        self.u: D = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: D = None
        self.o: H = None
        self.z: H = None
        self.t: A = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: F = None
        self.s: H = None
        self.u: D = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: D = None
        self.o: H = None
        self.z: H = None
        self.t: A = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

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