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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: G = None
        self.v: F = None
        self.z: B = None
        self.o: J = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.x: C = None
        self.u: B = None
        self.r: B = None
        self.q: E = None
        self.t: B = None
        self.v: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: G = None
        self.v: F = None
        self.z: B = None
        self.o: J = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.x: C = None
        self.u: B = None
        self.r: B = None
        self.q: E = None
        self.t: B = None
        self.v: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.q: D = None
        self.txt = txt

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

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