class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.q: D = None
        self.v: F = None
        self.p: D = None
        self.o: B = None
        self.r: B = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: H = None
        self.p: D = None
        self.s: D = None
        self.x: E = None
        self.w: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: E = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.t: E = None
        self.w: F = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

e.w = d
e.v = d
e.t = d
e.y = h
e.o = h
e.r = h
e.q = k
e.p = k
h.t = n
h.u = n
h.p = k
h.s = k
h.x = f
h.w = e
h.y = m
m.x = k
m.t = f
m.r = d
m.p = d
k.x = d
k.q = d
k.p = f
k.v = f
k.t = e
k.s = m
k.z = m
f.y = h
f.v = h
f.z = e
f.u = e
d.r = f
d.v = e
d.p = e
d.o = e
d.t = m
l.u = n
n.s = k
n.z = d
n.w = d
n.t = f
n.r = e
n.u = e
assert f.v.w.w.t.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: B = None
        self.q: D = None
        self.v: F = None
        self.p: D = None
        self.o: B = None
        self.r: B = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: H = None
        self.p: D = None
        self.s: D = None
        self.x: E = None
        self.w: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: E = None
        self.r: F = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: F = None
        self.t: E = None
        self.w: F = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

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