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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: D = None
        self.y: I = None
        self.q: E = None
        self.z: D = None
        self.x: C = None
        self.w: C = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: J = None
        self.z: J = None
        self.s: F = None
        self.r: J = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: G = None
        self.o: E = None
        self.w: G = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: G = None
        self.txt = txt

h = A("h")
c = B("c")
k = C("k")
g = D("g")
l = E("l")
m = F("m")
e = G("e")
j = H("j")
b = I("b")
f = J("f")

h.v = k
h.r = l
h.u = l
h.o = f
c.p = b
c.y = b
c.v = g
c.z = g
c.q = l
c.x = k
c.w = k
c.o = h
k.x = c
k.o = g
k.u = j
g.w = b
g.v = f
g.z = f
g.r = f
g.s = m
g.y = j
l.w = g
l.r = h
m.v = l
m.o = l
m.s = e
m.w = e
m.q = j
e.t = g
e.y = c
e.u = l
j.t = k
j.q = k
j.z = h
b.y = f
f.t = c
f.p = e
assert b.y.p.u.r.u.w.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: E = None
        self.u: E = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.v: D = None
        self.y: I = None
        self.q: E = None
        self.z: D = None
        self.x: C = None
        self.w: C = None
        self.o: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: J = None
        self.z: J = None
        self.s: F = None
        self.r: J = None
        self.y: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.s: G = None
        self.o: E = None
        self.w: G = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: G = None
        self.txt = txt

h = A("h")
c = B("c")
k = C("k")
g = D("g")
l = E("l")
m = F("m")
e = G("e")
j = H("j")
b = I("b")
f = J("f")

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