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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.x: C = None
        self.s: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.r: A = None
        self.u: A = None
        self.z: A = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

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

n = A("n")
e = B("e")
b = C("b")
f = D("f")
a = E("a")
h = F("h")
d = G("d")

n.s = h
n.o = f
e.t = a
e.v = b
b.o = a
b.p = h
b.w = e
f.z = e
f.w = a
f.t = b
a.w = h
a.s = h
a.y = n
a.x = b
a.o = e
h.t = a
h.s = f
h.p = f
h.r = n
h.u = n
h.z = n
h.y = b
d.z = n
d.t = a
d.u = e
d.y = b
assert d.u.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: A = None
        self.x: C = None
        self.s: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.r: A = None
        self.u: A = None
        self.z: A = None
        self.y: C = None
        self.p: D = None
        self.txt = txt

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

n = A("n")
e = B("e")
b = C("b")
f = D("f")
a = E("a")
h = F("h")
d = G("d")

n.s = h
n.o = f
e.t = a
e.v = b
b.o = a
b.p = h
b.w = e
f.z = e
f.w = a
f.t = b
a.w = h
a.s = h
a.y = n
a.x = b
a.o = e
h.t = a
h.s = f
h.p = f
h.r = n
h.u = n
h.z = n
h.y = b
d.z = n
d.t = a
d.u = e
d.y = b
assert d.u.t.y.txt == "n"