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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.r: D = None
        self.z: E = None
        self.q: A = None
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.q: D = None
        self.x: E = None
        self.t: G = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

l = A("l")
c = B("c")
a = C("a")
i = D("i")
b = E("b")
e = F("e")
h = G("h")
g = G("g")
f = D("f")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.r: D = None
        self.z: E = None
        self.q: A = None
        self.x: C = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.q: D = None
        self.x: E = None
        self.t: G = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

l = A("l")
c = B("c")
a = C("a")
i = D("i")
b = E("b")
e = F("e")
h = G("h")
g = G("g")
f = D("f")

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