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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.o: G = None
        self.p: G = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.w: C = 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.o: D = None
        self.t: D = None
        self.w: D = None
        self.y: A = None
        self.p: F = None
        self.x: B = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: B = None
        self.o: G = None
        self.p: G = None
        self.z: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.w: C = 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.o: D = None
        self.t: D = None
        self.w: D = None
        self.y: A = None
        self.p: F = None
        self.x: B = None
        self.s: A = None
        self.txt = txt

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

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