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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: G = None
        self.t: G = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

k = A("k")
d = B("d")
f = C("f")
i = D("i")
c = E("c")
e = F("e")
b = G("b")
l = H("l")
h = F("h")

k.v = l
k.s = i
k.w = i
d.z = b
d.q = b
d.u = e
f.p = i
f.y = k
f.s = h
i.u = b
i.s = k
i.z = h
c.y = k
c.u = k
c.s = d
e.v = h
e.q = b
e.t = b
e.s = i
e.p = f
b.z = l
b.v = f
l.u = f
h.v = e
h.q = b
h.t = b
h.s = i
h.p = f
assert k.s.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: D = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: G = None
        self.t: G = None
        self.s: D = None
        self.p: C = None
        self.txt = txt

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

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

k = A("k")
d = B("d")
f = C("f")
i = D("i")
c = E("c")
e = F("e")
b = G("b")
l = H("l")
h = F("h")

k.v = l
k.s = i
k.w = i
d.z = b
d.q = b
d.u = e
f.p = i
f.y = k
f.s = h
i.u = b
i.s = k
i.z = h
c.y = k
c.u = k
c.s = d
e.v = h
e.q = b
e.t = b
e.s = i
e.p = f
b.z = l
b.v = f
l.u = f
h.v = e
h.q = b
h.t = b
h.s = i
h.p = f
assert k.s.u.z.u.txt == "f"