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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: A = None
        self.y: C = None
        self.t: F = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.z: C = None
        self.s: E = None
        self.r: G = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: A = None
        self.y: C = None
        self.t: F = None
        self.x: F = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.z: C = None
        self.s: E = None
        self.r: G = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.z: D = None
        self.txt = txt

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

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