class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.p: A = None
        self.z: A = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.s: D = None
        self.t: C = None
        self.txt = txt

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

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

m.x = e
m.z = e
m.r = l
l.s = f
e.z = m
e.y = g
d.z = l
d.x = g
i.o = m
i.y = m
i.p = m
i.z = m
i.r = m
i.u = l
a.r = m
a.x = m
a.s = d
a.t = e
g.s = a
g.w = e
g.u = m
g.y = i
f.r = m
f.x = m
f.s = d
f.t = e
assert g.u.r.s.s.z.s.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.p: A = None
        self.z: A = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.s: D = None
        self.t: C = None
        self.txt = txt

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

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

m.x = e
m.z = e
m.r = l
l.s = f
e.z = m
e.y = g
d.z = l
d.x = g
i.o = m
i.y = m
i.p = m
i.z = m
i.r = m
i.u = l
a.r = m
a.x = m
a.s = d
a.t = e
g.s = a
g.w = e
g.u = m
g.y = i
f.r = m
f.x = m
f.s = d
f.t = e
assert g.u.r.s.s.z.s.s.z.txt == "l"