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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: A = None
        self.v: D = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: D = None
        self.o: H = None
        self.z: B = None
        self.y: H = None
        self.s: H = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.q: H = None
        self.t: F = None
        self.p: B = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

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

d = A("d")
g = B("g")
j = C("j")
k = D("k")
n = E("n")
f = F("f")
e = G("e")
a = H("a")

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: A = None
        self.v: D = None
        self.u: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: D = None
        self.o: H = None
        self.z: B = None
        self.y: H = None
        self.s: H = None
        self.u: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.q: H = None
        self.t: F = None
        self.p: B = None
        self.w: D = None
        self.v: F = None
        self.txt = txt

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

d = A("d")
g = B("g")
j = C("j")
k = D("k")
n = E("n")
f = F("f")
e = G("e")
a = H("a")

d.o = n
d.u = k
d.z = j
d.r = g
g.p = k
g.v = k
g.z = d
g.u = e
j.o = a
j.v = a
k.w = n
k.r = a
n.r = e
n.w = k
n.u = k
n.o = a
n.y = a
n.s = a
n.z = g
f.p = e
f.x = a
e.s = f
e.t = f
e.v = f
e.x = k
e.w = k
e.q = a
e.p = g
a.t = j
a.y = j
a.x = n
a.q = n
a.s = n
a.r = d
a.v = g
a.z = f
assert k.r.r.z.v.txt == "a"