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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.v: D = None
        self.z: G = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
l = C("l")
i = D("i")
d = E("d")
j = F("j")
a = G("a")

h.s = a
h.y = a
h.z = d
h.o = d
b.t = h
b.s = j
b.v = i
b.z = a
b.y = d
l.o = i
l.v = i
l.w = j
i.y = b
d.u = j
d.o = l
d.y = l
j.v = d
j.t = d
j.p = a
j.u = b
j.w = h
a.z = j
a.v = d
a.u = l
a.o = l
a.r = i
assert a.z.p.v.o.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: E = None
        self.y: G = None
        self.o: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.v: D = None
        self.z: G = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
b = B("b")
l = C("l")
i = D("i")
d = E("d")
j = F("j")
a = G("a")

h.s = a
h.y = a
h.z = d
h.o = d
b.t = h
b.s = j
b.v = i
b.z = a
b.y = d
l.o = i
l.v = i
l.w = j
i.y = b
d.u = j
d.o = l
d.y = l
j.v = d
j.t = d
j.p = a
j.u = b
j.w = h
a.z = j
a.v = d
a.u = l
a.o = l
a.r = i
assert a.z.p.v.o.w.p.txt == "a"