class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.y: D = None
        self.z: F = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.p: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.y: D = None
        self.z: F = None
        self.x: H = None
        self.t: B = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.p: H = None
        self.txt = txt

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

b.p = n
j.q = b
g.w = h
d.o = n
n.p = j
n.t = j
n.w = h
n.y = d
n.z = i
n.x = f
i.u = b
i.o = b
h.s = f
f.p = b
f.u = g
f.y = a
f.v = h
f.x = h
f.o = n
f.z = i
a.u = n
a.w = i
a.p = f
e.o = n
assert b.p.w.s.z.o.p.z.u.txt == "b"