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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: A = None
        self.v: F = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.z: F = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.p: C = None
        self.y: E = None
        self.q: G = None
        self.t: C = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: C = None
        self.w: G = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: A = None
        self.v: F = None
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: E = None
        self.z: F = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: G = None
        self.p: C = None
        self.y: E = None
        self.q: G = None
        self.t: C = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: C = None
        self.w: G = None
        self.t: D = None
        self.o: B = None
        self.txt = txt

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

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