class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.x: D = None
        self.s: F = None
        self.t: E = None
        self.o: H = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: G = None
        self.s: G = None
        self.x: F = None
        self.z: B = None
        self.o: C = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.z: E = None
        self.t: A = None
        self.txt = txt

g = A("g")
l = B("l")
m = C("m")
d = D("d")
e = E("e")
f = F("f")
k = G("k")
h = H("h")

g.v = d
g.x = d
g.w = l
g.y = l
g.s = f
g.t = e
g.o = h
g.z = m
l.v = m
m.v = f
d.t = l
d.r = l
d.p = m
d.u = g
e.t = k
e.w = k
e.s = k
e.x = f
e.z = l
e.o = m
e.q = d
e.y = h
f.w = l
f.q = h
k.o = h
k.q = l
k.s = l
h.w = m
h.y = d
h.z = e
h.t = g
assert e.q.u.o.z.x.w.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: B = None
        self.x: D = None
        self.s: F = None
        self.t: E = None
        self.o: H = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: G = None
        self.s: G = None
        self.x: F = None
        self.z: B = None
        self.o: C = None
        self.q: D = None
        self.y: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: D = None
        self.z: E = None
        self.t: A = None
        self.txt = txt

g = A("g")
l = B("l")
m = C("m")
d = D("d")
e = E("e")
f = F("f")
k = G("k")
h = H("h")

g.v = d
g.x = d
g.w = l
g.y = l
g.s = f
g.t = e
g.o = h
g.z = m
l.v = m
m.v = f
d.t = l
d.r = l
d.p = m
d.u = g
e.t = k
e.w = k
e.s = k
e.x = f
e.z = l
e.o = m
e.q = d
e.y = h
f.w = l
f.q = h
k.o = h
k.q = l
k.s = l
h.w = m
h.y = d
h.z = e
h.t = g
assert e.q.u.o.z.x.w.v.v.txt == "f"