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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

e = A("e")
g = B("g")
k = C("k")
j = D("j")
h = E("h")
d = F("d")
l = G("l")
b = F("b")

e.s = g
e.v = k
g.s = e
g.v = l
g.o = j
k.o = l
k.q = g
j.s = h
h.x = l
h.z = l
h.o = e
h.s = e
h.p = d
d.w = j
d.v = j
d.z = l
d.y = h
d.u = b
d.o = k
l.z = e
l.y = k
l.t = g
b.w = j
b.v = j
b.z = l
b.y = h
b.u = d
b.o = k
assert g.s.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: B = None
        self.txt = txt

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

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

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

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

e = A("e")
g = B("g")
k = C("k")
j = D("j")
h = E("h")
d = F("d")
l = G("l")
b = F("b")

e.s = g
e.v = k
g.s = e
g.v = l
g.o = j
k.o = l
k.q = g
j.s = h
h.x = l
h.z = l
h.o = e
h.s = e
h.p = d
d.w = j
d.v = j
d.z = l
d.y = h
d.u = b
d.o = k
l.z = e
l.y = k
l.t = g
b.w = j
b.v = j
b.z = l
b.y = h
b.u = d
b.o = k
assert g.s.s.s.s.s.s.txt == "g"