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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: J = None
        self.q: H = None
        self.t: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: C = None
        self.z: G = None
        self.v: A = None
        self.q: J = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.s: A = None
        self.p: B = None
        self.v: J = None
        self.q: H = None
        self.y: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: D = None
        self.r: C = None
        self.txt = txt

g = A("g")
e = B("e")
a = C("a")
i = D("i")
d = E("d")
c = F("c")
k = G("k")
l = H("l")
f = I("f")
b = J("b")

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: J = None
        self.q: H = None
        self.t: C = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: C = None
        self.z: G = None
        self.v: A = None
        self.q: J = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.s: A = None
        self.p: B = None
        self.v: J = None
        self.q: H = None
        self.y: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: J = None
        self.z: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: D = None
        self.r: C = None
        self.txt = txt

g = A("g")
e = B("e")
a = C("a")
i = D("i")
d = E("d")
c = F("c")
k = G("k")
l = H("l")
f = I("f")
b = J("b")

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