class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: G = None
        self.p: B = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.t: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.r: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: C = None
        self.t: F = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.r: C = None
        self.txt = txt

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

d.s = i
d.z = j
d.p = l
d.q = h
l.z = h
l.o = g
h.o = e
e.v = l
g.u = j
g.o = h
g.t = c
g.s = c
c.w = h
j.u = e
j.p = e
j.r = h
i.s = d
i.z = j
i.p = l
i.q = h
assert j.r.o.v.o.t.w.o.txt == "e"