class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: E = None
        self.s: B = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.x: A = None
        self.v: G = None
        self.o: B = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.x: A = None
        self.v: G = None
        self.o: B = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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