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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: H = None
        self.t: C = None
        self.w: E = None
        self.x: C = None
        self.v: E = None
        self.txt = txt

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

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

f.w = i
f.y = c
f.s = m
c.u = m
l.x = c
h.y = a
h.o = c
h.w = n
a.y = m
m.x = h
m.t = n
m.r = a
m.y = i
m.s = f
m.z = f
m.u = l
m.w = c
n.r = l
n.t = l
n.x = l
n.p = i
n.w = a
n.v = a
i.v = a
assert f.w.v.y.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: B = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: H = None
        self.t: C = None
        self.w: E = None
        self.x: C = None
        self.v: E = None
        self.txt = txt

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

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

f.w = i
f.y = c
f.s = m
c.u = m
l.x = c
h.y = a
h.o = c
h.w = n
a.y = m
m.x = h
m.t = n
m.r = a
m.y = i
m.s = f
m.z = f
m.u = l
m.w = c
n.r = l
n.t = l
n.x = l
n.p = i
n.w = a
n.v = a
i.v = a
assert f.w.v.y.x.o.txt == "c"