class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: C = None
        self.v: E = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: C = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.u: D = None
        self.x: H = None
        self.q: A = None
        self.txt = txt

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

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

d.x = f
d.q = f
d.u = a
d.v = k
i.w = k
a.o = d
a.p = e
a.z = i
h.o = f
h.s = a
h.q = d
h.z = k
k.s = f
k.u = e
k.w = h
m.z = d
m.p = d
m.x = k
f.w = a
f.o = a
f.u = h
f.x = e
f.q = d
e.z = i
e.v = k
e.o = f
assert f.u.z.u.z.w.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: C = None
        self.v: E = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: C = None
        self.q: A = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.u: D = None
        self.x: H = None
        self.q: A = None
        self.txt = txt

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

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

d.x = f
d.q = f
d.u = a
d.v = k
i.w = k
a.o = d
a.p = e
a.z = i
h.o = f
h.s = a
h.q = d
h.z = k
k.s = f
k.u = e
k.w = h
m.z = d
m.p = d
m.x = k
f.w = a
f.o = a
f.u = h
f.x = e
f.q = d
e.z = i
e.v = k
e.o = f
assert f.u.z.u.z.w.u.o.txt == "f"