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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.q: C = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.q: C = None
        self.r: H = None
        self.txt = txt

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

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

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

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