class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

f.v = h
f.s = h
f.p = d
b.t = d
b.z = d
b.q = h
b.u = l
b.w = e
b.y = g
b.x = g
b.r = g
l.w = n
l.q = h
l.o = h
e.s = f
e.w = h
h.z = b
h.r = e
n.x = b
n.r = l
n.p = l
n.v = f
n.w = g
n.o = g
n.z = e
d.u = h
g.o = l
assert e.w.z.z.u.z.t.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: E = None
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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