class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: B = None
        self.t: H = None
        self.z: D = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.y: G = None
        self.t: G = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: F = None
        self.v: D = None
        self.y: C = None
        self.o: G = None
        self.p: G = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.s: H = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.y: C = None
        self.s: C = None
        self.q: G = None
        self.u: C = None
        self.o: E = None
        self.t: C = None
        self.txt = txt

d = A("d")
n = B("n")
c = C("c")
a = D("a")
h = E("h")
i = F("i")
e = G("e")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: E = None
        self.y: G = None
        self.t: G = None
        self.r: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: F = None
        self.v: D = None
        self.y: C = None
        self.o: G = None
        self.p: G = None
        self.w: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: D = None
        self.s: H = None
        self.x: E = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.y: C = None
        self.s: C = None
        self.q: G = None
        self.u: C = None
        self.o: E = None
        self.t: C = None
        self.txt = txt

d = A("d")
n = B("n")
c = C("c")
a = D("a")
h = E("h")
i = F("i")
e = G("e")
k = H("k")

d.p = a
d.z = a
d.r = n
d.t = k
d.v = i
n.q = a
n.u = e
n.s = d
n.p = h
c.z = n
a.x = e
a.y = e
a.t = e
a.q = h
a.r = d
h.x = k
h.t = i
h.v = a
h.y = c
h.w = c
h.o = e
h.p = e
i.u = d
i.r = a
i.s = k
i.x = h
i.w = h
e.s = a
k.w = h
k.o = h
k.v = d
k.y = c
k.s = c
k.u = c
k.t = c
k.q = e
assert c.z.u.s.txt == "a"