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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.z: E = None
        self.w: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.z: E = None
        self.w: C = None
        self.u: E = None
        self.txt = txt

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

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