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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

b.u = e
b.x = g
i.o = b
i.p = g
i.t = g
i.v = g
i.u = n
i.s = j
i.y = c
i.w = e
i.r = f
k.p = e
k.z = e
k.w = e
k.y = j
k.s = j
k.x = b
k.r = i
c.t = j
c.w = g
g.x = j
g.y = j
g.r = e
g.z = e
g.p = k
g.t = k
g.u = n
n.r = k
n.s = b
j.x = n
e.y = n
e.s = b
e.w = j
l.r = i
l.o = g
l.s = n
f.t = j
f.w = g
assert i.o.u.y.r.s.x.r.w.s.txt == "b"