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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: I = None
        self.q: F = None
        self.r: E = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: B = None
        self.p: A = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: C = None
        self.u: J = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: H = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: I = None
        self.q: F = None
        self.r: E = None
        self.u: D = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: B = None
        self.p: A = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.z: C = None
        self.u: J = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: H = None
        self.v: A = None
        self.p: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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