class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: E = None
        self.w: I = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: H = None
        self.t: I = None
        self.s: H = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: A = None
        self.x: I = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: I = None
        self.p: I = None
        self.w: F = None
        self.o: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.x: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: H = None
        self.t: I = None
        self.s: H = None
        self.v: B = None
        self.p: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: A = None
        self.x: I = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: I = None
        self.p: I = None
        self.w: F = None
        self.o: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.x: C = None
        self.r: C = None
        self.txt = txt

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

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