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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: H = None
        self.o: F = None
        self.p: G = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.r: C = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.z: A = None
        self.x: E = None
        self.r: E = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: H = None
        self.o: F = None
        self.p: G = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: A = None
        self.r: C = None
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.z: A = None
        self.x: E = None
        self.r: E = None
        self.o: E = None
        self.txt = txt

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

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