class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: B = None
        self.r: H = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: H = None
        self.txt = txt

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

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

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