class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: G = None
        self.z: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: H = None
        self.s: C = None
        self.v: C = None
        self.x: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: H = None
        self.s: C = None
        self.v: C = None
        self.x: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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