class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = 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.q: I = None
        self.s: B = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.v: I = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.o: F = None
        self.t: G = None
        self.s: C = None
        self.x: E = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

j = A("j")
e = B("e")
i = C("i")
b = D("b")
m = E("m")
n = F("n")
k = G("k")
g = H("g")
f = I("f")

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = 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.q: I = None
        self.s: B = None
        self.u: A = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: C = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.v: I = None
        self.s: F = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.o: F = None
        self.t: G = None
        self.s: C = None
        self.x: E = None
        self.u: G = None
        self.q: D = None
        self.txt = txt

j = A("j")
e = B("e")
i = C("i")
b = D("b")
m = E("m")
n = F("n")
k = G("k")
g = H("g")
f = I("f")

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