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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.p: G = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.v: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.p: F = None
        self.y: E = None
        self.u: D = None
        self.v: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: E = None
        self.p: G = None
        self.z: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: B = None
        self.v: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.p: F = None
        self.y: E = None
        self.u: D = None
        self.v: A = None
        self.txt = txt

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

i.p = a
i.w = m
i.z = n
k.x = n
k.p = m
k.u = i
f.y = d
f.z = d
f.x = c
f.p = n
a.u = d
a.p = k
a.y = m
a.q = f
a.v = f
a.z = f
a.r = c
c.q = a
c.y = n
c.p = m
m.x = a
m.v = a
m.w = k
m.q = f
n.x = a
n.u = a
d.x = m
d.p = m
d.q = i
d.v = i
d.y = c
d.u = a
assert a.y.q.x.y.txt == "n"