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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.q: A = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.z: E = None
        self.p: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: D = None
        self.q: A = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.z: E = None
        self.p: A = None
        self.txt = txt

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

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