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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.w: A = None
        self.v: B = None
        self.o: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.w: A = None
        self.v: B = None
        self.o: F = None
        self.r: D = None
        self.txt = txt

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

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