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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: D = None
        self.u: A = None
        self.o: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: E = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: E = None
        self.o: G = None
        self.w: C = None
        self.q: C = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.t: D = None
        self.u: A = None
        self.o: C = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: E = None
        self.o: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: E = None
        self.o: G = None
        self.w: C = None
        self.q: C = None
        self.u: C = None
        self.txt = txt

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

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