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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.u: B = None
        self.q: G = None
        self.v: I = None
        self.s: F = None
        self.z: I = None
        self.w: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.s: D = None
        self.r: F = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.u: B = None
        self.q: G = None
        self.v: I = None
        self.s: F = None
        self.z: I = None
        self.w: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.s: D = None
        self.r: F = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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