class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.u: F = None
        self.y: B = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.v: F = None
        self.q: C = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: D = None
        self.t: E = None
        self.txt = txt

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

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

n.q = f
n.s = f
n.o = l
n.u = k
n.y = c
c.y = g
c.v = g
c.z = g
c.u = e
c.x = e
c.p = k
c.s = h
c.o = n
l.z = e
l.s = n
e.t = k
e.s = c
h.s = l
h.t = l
h.q = l
h.u = l
h.v = k
h.x = e
k.p = f
f.y = n
f.w = e
f.t = h
g.s = n
g.p = n
g.t = f
g.w = f
g.o = k
g.y = e
assert c.z.p.o.z.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.u: F = None
        self.y: B = None
        self.s: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.v: F = None
        self.q: C = None
        self.u: C = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: D = None
        self.t: E = None
        self.txt = txt

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

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

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