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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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