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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.x: A = None
        self.y: H = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

j.v = c
h.u = f
h.q = f
f.v = h
f.w = j
f.x = a
f.p = g
f.s = k
f.t = m
k.w = a
k.u = a
k.x = m
g.x = k
g.w = f
a.v = g
a.u = g
a.w = g
a.r = j
a.x = j
a.y = c
m.u = c
c.y = f
b.w = a
b.u = a
b.x = m
assert c.y.x.x.v.y.v.q.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: F = None
        self.x: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: A = None
        self.x: A = None
        self.y: H = None
        self.u: E = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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