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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

c = A("c")
m = B("m")
g = C("g")
i = D("i")
h = E("h")
k = F("k")
d = G("d")
a = G("a")

c.w = d
c.p = i
c.r = g
m.s = g
m.y = k
m.r = i
m.u = h
m.w = d
m.p = a
g.v = m
i.x = c
i.q = c
i.v = d
h.s = i
h.x = g
k.y = h
d.v = g
d.o = k
d.s = k
d.w = i
d.q = m
d.z = a
d.y = a
a.v = g
a.o = k
a.s = k
a.w = i
a.q = m
a.z = d
a.y = d
assert i.q.r.v.u.s.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: D = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

c = A("c")
m = B("m")
g = C("g")
i = D("i")
h = E("h")
k = F("k")
d = G("d")
a = G("a")

c.w = d
c.p = i
c.r = g
m.s = g
m.y = k
m.r = i
m.u = h
m.w = d
m.p = a
g.v = m
i.x = c
i.q = c
i.v = d
h.s = i
h.x = g
k.y = h
d.v = g
d.o = k
d.s = k
d.w = i
d.q = m
d.z = a
d.y = a
a.v = g
a.o = k
a.s = k
a.w = i
a.q = m
a.z = d
a.y = d
assert i.q.r.v.u.s.v.v.txt == "g"