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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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