class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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