class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: F = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: H = None
        self.u: G = None
        self.w: H = None
        self.x: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: B = None
        self.w: A = None
        self.r: C = None
        self.s: A = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: H = None
        self.u: G = None
        self.w: H = None
        self.x: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: B = None
        self.w: A = None
        self.r: C = None
        self.s: A = None
        self.t: G = None
        self.y: H = None
        self.txt = txt

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

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

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

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

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