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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.q: C = None
        self.t: F = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.q: C = None
        self.t: F = None
        self.p: F = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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