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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

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

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

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