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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

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