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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: F = None
        self.o: B = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: F = None
        self.o: B = None
        self.x: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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