class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.u: E = None
        self.w: C = None
        self.z: G = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: D = None
        self.q: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

d = A("d")
m = B("m")
g = C("g")
h = D("h")
c = E("c")
a = F("a")
b = G("b")
i = H("i")
n = I("n")
k = J("k")

d.r = c
d.z = c
d.t = b
m.v = h
m.x = h
m.u = c
m.w = g
m.z = b
m.p = d
g.u = c
g.r = h
g.q = k
h.x = m
c.q = i
c.t = b
a.r = d
b.y = m
b.u = a
i.t = b
i.x = b
i.y = m
i.w = n
n.t = b
k.p = h
k.x = b
k.s = g
k.z = a
assert d.t.y.u.t.y.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: G = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.u: E = None
        self.w: C = None
        self.z: G = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: D = None
        self.q: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: G = None
        self.s: C = None
        self.z: F = None
        self.txt = txt

d = A("d")
m = B("m")
g = C("g")
h = D("h")
c = E("c")
a = F("a")
b = G("b")
i = H("i")
n = I("n")
k = J("k")

d.r = c
d.z = c
d.t = b
m.v = h
m.x = h
m.u = c
m.w = g
m.z = b
m.p = d
g.u = c
g.r = h
g.q = k
h.x = m
c.q = i
c.t = b
a.r = d
b.y = m
b.u = a
i.t = b
i.x = b
i.y = m
i.w = n
n.t = b
k.p = h
k.x = b
k.s = g
k.z = a
assert d.t.y.u.t.y.p.t.txt == "b"