class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: D = None
        self.x: E = None
        self.q: I = None
        self.v: H = None
        self.r: A = None
        self.t: D = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: D = None
        self.o: G = None
        self.r: C = None
        self.x: A = None
        self.y: C = None
        self.w: B = None
        self.s: G = None
        self.txt = txt

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

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

b.o = l
n.w = i
n.u = i
c.o = m
c.q = m
c.w = i
c.t = i
c.x = f
c.v = l
c.y = l
c.r = b
c.s = n
i.s = k
i.t = f
f.s = b
f.v = i
k.t = n
k.p = c
k.q = l
d.p = c
l.q = m
l.u = i
l.o = d
l.s = d
l.r = c
l.y = c
l.x = b
l.w = n
m.t = k
m.x = b
g.s = b
g.v = i
assert f.s.o.u.t.s.o.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: D = None
        self.x: E = None
        self.q: I = None
        self.v: H = None
        self.r: A = None
        self.t: D = None
        self.s: B = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.u: D = None
        self.o: G = None
        self.r: C = None
        self.x: A = None
        self.y: C = None
        self.w: B = None
        self.s: G = None
        self.txt = txt

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

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

b.o = l
n.w = i
n.u = i
c.o = m
c.q = m
c.w = i
c.t = i
c.x = f
c.v = l
c.y = l
c.r = b
c.s = n
i.s = k
i.t = f
f.s = b
f.v = i
k.t = n
k.p = c
k.q = l
d.p = c
l.q = m
l.u = i
l.o = d
l.s = d
l.r = c
l.y = c
l.x = b
l.w = n
m.t = k
m.x = b
g.s = b
g.v = i
assert f.s.o.u.t.s.o.r.w.txt == "i"