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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: H = None
        self.s: F = None
        self.q: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.r: A = None
        self.x: G = None
        self.q: D = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: E = None
        self.r: D = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: H = None
        self.s: F = None
        self.q: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: B = None
        self.r: A = None
        self.x: G = None
        self.q: D = None
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: B = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: E = None
        self.r: D = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.txt = txt

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

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