class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.y: D = None
        self.t: F = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: I = None
        self.o: D = None
        self.y: B = None
        self.s: A = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: G = None
        self.y: D = None
        self.x: A = None
        self.z: B = None
        self.s: E = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: I = None
        self.o: D = None
        self.y: B = None
        self.s: A = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: B = None
        self.t: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: G = None
        self.y: D = None
        self.x: A = None
        self.z: B = None
        self.s: E = None
        self.q: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.x: E = None
        self.txt = txt

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

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