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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: E = None
        self.t: A = None
        self.s: F = None
        self.q: F = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: D = None
        self.txt = txt

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

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

b.v = m
b.s = l
b.r = c
a.p = c
a.o = c
a.v = n
a.w = l
c.v = b
c.t = b
c.p = i
c.o = i
c.z = i
c.s = l
c.q = l
n.t = a
n.v = a
i.p = c
i.t = m
i.o = l
i.w = l
l.w = m
l.v = n
m.u = b
m.q = b
m.o = i
m.t = i
m.v = a
m.x = l
m.z = c
assert m.u.s.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: E = None
        self.t: A = None
        self.s: F = None
        self.q: F = None
        self.o: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: D = None
        self.txt = txt

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

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

b.v = m
b.s = l
b.r = c
a.p = c
a.o = c
a.v = n
a.w = l
c.v = b
c.t = b
c.p = i
c.o = i
c.z = i
c.s = l
c.q = l
n.t = a
n.v = a
i.p = c
i.t = m
i.o = l
i.w = l
l.w = m
l.v = n
m.u = b
m.q = b
m.o = i
m.t = i
m.v = a
m.x = l
m.z = c
assert m.u.s.w.q.txt == "b"