class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: F = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: F = None
        self.r: H = None
        self.v: H = None
        self.s: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: F = None
        self.r: H = None
        self.v: H = None
        self.s: A = None
        self.txt = txt

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

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

n.v = f
n.x = f
n.o = j
i.r = a
h.p = n
h.r = f
h.o = f
h.z = j
h.v = j
j.x = e
j.r = h
d.o = a
f.p = e
a.p = e
a.r = e
a.v = e
a.o = f
a.s = n
e.u = i
e.o = i
assert d.o.o.p.txt == "e"