class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: H = None
        self.y: E = None
        self.u: C = None
        self.w: A = None
        self.q: E = None
        self.x: G = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.r: B = None
        self.v: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

h = A("h")
j = B("j")
e = C("e")
k = D("k")
g = E("g")
b = F("b")
l = G("l")
f = H("f")

h.u = f
h.z = k
j.r = h
j.w = h
j.s = h
j.z = f
j.y = g
j.q = g
j.u = e
j.x = l
e.p = k
k.z = f
g.x = h
g.p = j
g.r = j
b.p = h
l.u = e
l.w = e
l.z = e
l.r = j
l.v = j
l.x = g
f.z = k
f.v = j
f.s = g
f.y = h
assert e.p.z.s.x.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: H = None
        self.y: E = None
        self.u: C = None
        self.w: A = None
        self.q: E = None
        self.x: G = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: B = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.r: B = None
        self.v: B = None
        self.x: E = None
        self.z: C = None
        self.txt = txt

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

h = A("h")
j = B("j")
e = C("e")
k = D("k")
g = E("g")
b = F("b")
l = G("l")
f = H("f")

h.u = f
h.z = k
j.r = h
j.w = h
j.s = h
j.z = f
j.y = g
j.q = g
j.u = e
j.x = l
e.p = k
k.z = f
g.x = h
g.p = j
g.r = j
b.p = h
l.u = e
l.w = e
l.z = e
l.r = j
l.v = j
l.x = g
f.z = k
f.v = j
f.s = g
f.y = h
assert e.p.z.s.x.u.z.txt == "k"