class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: C = None
        self.y: C = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: E = None
        self.w: B = None
        self.t: F = None
        self.y: E = None
        self.u: I = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.u: D = None
        self.w: E = None
        self.r: B = None
        self.q: I = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: E = None
        self.w: B = None
        self.t: F = None
        self.y: E = None
        self.u: I = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.u: D = None
        self.w: E = None
        self.r: B = None
        self.q: I = None
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: A = None
        self.txt = txt

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

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