class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.z: C = None
        self.o: B = None
        self.v: F = None
        self.u: F = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: F = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: B = None
        self.t: E = None
        self.z: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: D = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.s: B = None
        self.txt = txt

f = A("f")
g = B("g")
h = C("h")
m = D("m")
c = E("c")
b = F("b")
i = G("i")
e = H("e")

f.y = h
f.z = h
f.t = m
f.o = g
f.v = b
f.u = b
f.r = e
g.w = f
h.s = m
h.y = b
h.u = g
h.x = c
m.u = c
m.t = c
m.w = g
m.z = g
m.p = h
c.r = b
c.u = f
c.y = m
b.z = i
b.o = e
i.o = f
i.u = m
i.s = h
i.r = g
e.q = m
e.z = i
e.s = g
assert b.o.z.r.w.v.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.z: C = None
        self.o: B = None
        self.v: F = None
        self.u: F = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: F = None
        self.u: B = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: B = None
        self.t: E = None
        self.z: B = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: D = None
        self.s: C = None
        self.r: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: G = None
        self.s: B = None
        self.txt = txt

f = A("f")
g = B("g")
h = C("h")
m = D("m")
c = E("c")
b = F("b")
i = G("i")
e = H("e")

f.y = h
f.z = h
f.t = m
f.o = g
f.v = b
f.u = b
f.r = e
g.w = f
h.s = m
h.y = b
h.u = g
h.x = c
m.u = c
m.t = c
m.w = g
m.z = g
m.p = h
c.r = b
c.u = f
c.y = m
b.z = i
b.o = e
i.o = f
i.u = m
i.s = h
i.r = g
e.q = m
e.z = i
e.s = g
assert b.o.z.r.w.v.z.u.txt == "m"