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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.p: C = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.p: C = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

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

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

l.s = b
d.y = b
d.q = m
d.x = g
d.s = i
d.w = n
d.z = c
b.u = m
b.p = m
b.s = n
b.t = n
b.r = g
b.v = e
b.y = c
e.p = c
e.t = m
e.v = m
e.s = b
n.x = b
n.w = e
m.z = d
m.w = n
m.p = b
m.v = e
m.r = a
c.t = m
c.v = m
c.u = a
c.s = e
c.x = b
c.y = n
i.y = b
i.q = m
i.x = g
i.s = d
i.w = n
i.z = c
a.s = b
g.t = m
g.v = m
g.u = l
g.s = e
g.x = b
g.y = n
assert i.x.t.r.txt == "a"