class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: C = None
        self.t: I = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: D = None
        self.w: D = None
        self.z: H = None
        self.q: H = None
        self.r: C = None
        self.t: H = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: J = None
        self.p: J = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: C = None
        self.y: A = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: D = None
        self.w: D = None
        self.z: H = None
        self.q: H = None
        self.r: C = None
        self.t: H = None
        self.p: D = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: J = None
        self.p: J = None
        self.w: D = None
        self.v: H = None
        self.txt = txt

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

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: C = None
        self.y: A = None
        self.p: C = None
        self.txt = txt

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

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