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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: H = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: G = None
        self.r: C = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: D = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: F = None
        self.u: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: H = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: G = None
        self.r: C = None
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: D = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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

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