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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.x: A = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.q: D = None
        self.s: B = None
        self.z: C = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
l = D("l")
g = E("g")
m = F("m")
a = G("a")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.x: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.x: A = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: A = None
        self.q: D = None
        self.s: B = None
        self.z: C = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

b = A("b")
i = B("i")
k = C("k")
l = D("l")
g = E("g")
m = F("m")
a = G("a")

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