class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: G = None
        self.q: D = None
        self.u: E = None
        self.x: F = None
        self.o: E = None
        self.z: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: G = None
        self.txt = txt

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

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

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