class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.w: D = None
        self.u: E = None
        self.y: H = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: E = None
        self.y: G = None
        self.q: H = None
        self.t: H = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.s: B = None
        self.z: F = None
        self.x: H = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: G = None
        self.txt = txt

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

n.z = b
n.r = b
n.w = j
n.u = d
n.y = k
n.x = c
n.q = c
g.x = d
g.w = d
g.y = b
g.q = k
g.t = k
g.v = j
c.r = n
j.r = n
j.q = h
j.z = h
j.s = g
j.u = g
j.x = k
d.w = k
h.y = c
h.o = j
b.o = k
b.y = g
k.x = n
k.o = b
assert n.u.w.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.w: D = None
        self.u: E = None
        self.y: H = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: E = None
        self.y: G = None
        self.q: H = None
        self.t: H = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.s: B = None
        self.z: F = None
        self.x: H = None
        self.u: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: G = None
        self.txt = txt

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

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