class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: E = None
        self.o: D = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: C = None
        self.x: D = None
        self.o: F = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.t: C = None
        self.q: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: C = None
        self.x: D = None
        self.o: F = None
        self.s: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.t: C = None
        self.q: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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