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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.r: A = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: G = None
        self.r: A = None
        self.v: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

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