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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: A = None
        self.o: B = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: G = None
        self.v: B = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: A = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.t: E = None
        self.q: B = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: A = None
        self.o: B = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: G = None
        self.v: B = None
        self.y: D = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: A = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.t: E = None
        self.q: B = None
        self.z: F = None
        self.x: A = None
        self.txt = txt

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

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