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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.t: D = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: C = None
        self.z: G = None
        self.u: G = None
        self.x: G = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.t: D = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: C = None
        self.z: G = None
        self.u: G = None
        self.x: G = None
        self.v: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

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