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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.q: F = None
        self.o: F = None
        self.u: F = None
        self.r: C = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: B = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.q: F = None
        self.o: F = None
        self.u: F = None
        self.r: C = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: G = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

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